// @ts-ignore
/* eslint-disable */
import request from '@/utils/request'

/** 此处后端没有提供注释 DELETE /dept/${param0} */
export async function deleteDept(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: UserService.deleteDeptParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params
  return request<UserService.ResultVoid>(`/user/dept/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 GET /dept/${param0}/detail */
export async function getDeptDetail(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: UserService.getDeptDetailParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params
  return request<UserService.ResultDeptVO>(`/user/dept/${param0}/detail`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 POST /dept/add */
export async function addDept(body: UserService.DeptSaveDTO, options?: { [key: string]: any }) {
  return request<UserService.Result>(`/user/dept/add`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 DELETE /dept/batch */
export async function deleteDeptBatch(body: number[], options?: { [key: string]: any }) {
  return request<UserService.ResultVoid>(`/user/dept/batch`, {
    method: 'DELETE',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 POST /dept/find */
export async function queryDeptPage(
  body: UserService.DeptQueryDTO,
  options?: { [key: string]: any }
) {
  return request<UserService.ResultIPageDeptVO>(`/user/dept/find`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 GET /dept/getDeptByUserId */
export async function findDeptByUserid(options?: { [key: string]: any }) {
  return request<UserService.Result>(`/user/dept/getDeptByUserId`, {
    method: 'GET',
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 POST /dept/update */
export async function updateDept(body: UserService.DeptSaveDTO, options?: { [key: string]: any }) {
  return request<UserService.ResultVoid>(`/user/dept/update`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 POST /dept/user/${param0} */
export async function updateDeptByUserId(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: UserService.updateDeptByUserIdParams,
  body: UserService.DeptSaveDTO,
  options?: { [key: string]: any }
) {
  const { userId: param0, ...queryParams } = params
  return request<UserService.ResultVoid>(`/user/dept/user/${param0}`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    params: { ...queryParams },
    data: body,
    ...(options || {}),
  })
}
